﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html ng-app="hpxAdminApp">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>编辑详细信息</title>
    <link rel="stylesheet" type="text/css" href="../assets/plugins/editor/kindeditor-4.1.10/themes/mycss/ms_angluar.css" />
    <link rel="stylesheet" type="text/css" href="../assets/plugins/bootstrap/css/bootstrap.css" />
    <script type="text/javascript" src="../assets/plugins/angularjs/angular.min.js"></script>
    <link rel="stylesheet" href="../assets/plugins/editor/kindeditor-4.1.10/themes/default/default.css" />
    <script charset="utf-8" src="../assets/plugins/editor/kindeditor-4.1.10/kindeditor.js"></script>
    <script charset="utf-8" src="../assets/plugins/editor/kindeditor-4.1.10/lang/zh_CN.js"></script>
    <script>

        hpxAdminApp.directive('msKindeditor',[function(){
            return {
                restrict:'EA',
                require:'?ngModel',
                scope:{
                },
                link:function(scope,element,attrs,kindEditorController){
                    var kindeditor;
                    KindEditor.ready(function(K){
                        kindeditor = K.create(element[0], {
                            fullscreenMode: false,
                            width: '100%',
                            height: '700px',
                            minWidth:'50px',
                            resizeType: 2,
                            wellFormatMode: true,
                            //uploadJson:   //待写
                            fontSizeTable:['9px', '11px','13px', '15px','17px', '19px','20px', '21px','22px', '23px','24px','25px','27px','29px','30px', '31px','32px','40px'],
                            afterChange:function(){
                                kindEditorController.$setViewValue(this.html());
                            }

                        });

                        kindEditorController.$render=function(){
                            kindeditor.html(kindEditorController.$viewValue);
                        }
                    });
                }
            }
        }]);
    </script>
</head>
<body>
    <div ng-controller="portalInformationController">
        <ol class="breadcrumb pull-right">
            <li><a ui-sref="app.home">汇票线</a></li>
            <li><a ui-sref="app.portalInformation">发布信息管理</a></li>
            <li class="active">编辑信息</li>
        </ol>
        <h1 class="page-header"><i class="fa fa-lg text-success fa-fax"></i>编辑信息</h1>

        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-inverse">
                    <div class="panel-heading">
                        <div class="panel-heading-btn">
                            <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
                            <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-repeat"></i></a>
                            <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
                            <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-danger" data-click="panel-remove"><i class="fa fa-times"></i></a>
                        </div>
                        <h4 class="panel-title">编辑信息</h4>
                    </div>


                    <div style="width:70%;height:50%;">
                        <ng-form name="editForm" novalidate>
                            <div>
                                <div class="form-horizontal form-inline">
                                    <div class="form-group width-full" ng-class="{ 'has-error': editForm.information_type_id.$invalid && !editForm.information_type_id.$pristine }">
                                        <label class="col-md-3 control-label"><font color="red">*</font> 发布信息类型: </label>
                                        <div class="col-md-8">
                                            <select ng-model="model.information_type_id" name="information_type_id" ng-options="item.id as item.information_type_name for item in informationTypes" class="form-control width-150">
                                                <option value="">请选择信息类型...</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group width-full" ng-class="{ 'has-error': editForm.main_keyword.$invalid && !editForm.main_keyword.$pristine }">
                                        <label class="col-md-3 control-label"><font color="red">*</font> 主关键字: </label>
                                        <div class="col-md-8">
                                            <input type="text" name="main_keyword" ng-model="model.main_keyword" class="form-control width-full" required />
                                        </div>
                                    </div>
                                    <div class="form-group width-full">
                                        <label class="col-md-3 control-label">次关键字: </label>
                                        <div class="col-md-8">
                                            <input type="text" name="second_keyword" ng-model="model.second_keyword" class="form-control width-full" />
                                        </div>
                                    </div>
                                    <div class="form-group width-full">
                                        <label class="col-md-3 control-label">第三关键字: </label>
                                        <div class="col-md-8">
                                            <input type="text" name="third_keyword" ng-model="model.third_keyword" class="form-control width-full" />
                                        </div>
                                    </div>
                                    <div class="form-group width-full" ng-class="{ 'has-error': editForm.title.$invalid && !editForm.title.$pristine }">
                                        <label class="col-md-3 control-label"><font color="red">*</font> 信息标题: </label>
                                        <div class="col-md-8">
                                            <input type="text" name="title" ng-model="model.title" class="form-control width-full" required />
                                        </div>
                                    </div>
                                    <div class="form-group width-full">
                                        <label class="col-md-3 control-label">信息副标题: </label>
                                        <div class="col-md-8">
                                            <input type="text" name="subtitle" ng-model="model.subtitle" class="form-control width-full" />
                                        </div>
                                    </div>
                                    <div class="form-group width-full">
                                        <label class="col-md-3 control-label">官方链接: </label>
                                        <div class="col-md-8">
                                            <input type="text" name="related_link" ng-model="model.related_link" class="form-control width-full" />
                                        </div>
                                    </div>
                                    <div class="form-group width-full">
                                        <label class="col-md-3 control-label">截止日期(仅适用于通知公告): </label>
                                        <div class="col-md-8">
                                            <input type="datetime-local" name="deadline_time" ng-model="model.deadline_time" class="form-control width-full" />
                                        </div>
                                    </div>
                                    <div class="form-group width-full">
                                        <label class="col-md-3 control-label"> 发布信息描述: </label>
                                        <div class="col-md-8">
                                            <input type="text" name="description" ng-model="model.description" class="form-control width-full" />
                                        </div>
                                    </div>
                                    <div class="form-group width-full">
                                        <div>
                                            <label class="col-md-3 control-label"> 编辑详细信息1: </label>
                                        </div>
                                        <!--<div ng-controller="detailCtr">-->
                                        <div>
                                            <!-- <ms-kindeditor ng-model="model.detail"></ms-kindeditor> -->
                                            <textarea id="textareDetail" ms-kindeditor ng-model="model.detail" style="width:850px;height:450px;"></textarea>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="submit" class="btn btn-sm btn-success" ng-click="save()" ng-disabled="editForm.$invalid"><i class="fa fa-save"></i> 保存</button>
                                <!--<button type="button" class="btn btn-sm btn-white" data-dismiss="modal"><i class="fa fa-share-square-o"></i> 关闭</button>-->
                            </div>
                        </ng-form>
                    </div>


                </div>
            </div>
        </div>
    </div>
</body>
</html>